#pragma once

#include "IReferenceCounter.h"
#include "Sol9Types.h"
#include "dimension2d.h"
#include "IEventReceiver.h"

namespace sol9
{
namespace device
{

	enum eDeviceTypes
	{
		EDT_Unknown,
		EDT_Win32,
	};

	struct SDeviceParameters
	{
		eDeviceTypes eDeviceType;
		std::tstring strWindowName;
		core::dimension2du nWindowSize;
		bool bFullscreen;

		SDeviceParameters()
			: eDeviceType(EDT_Unknown)
			, strWindowName(_T("UnknownName"))
			, nWindowSize(800, 600)
			, bFullscreen(false) {}
	};

	class IDevice : public IReferenceCounter
	{
		__declareBaseClass(IDevice);

	public:
		virtual bool run() = 0;
		virtual void close() = 0;
		virtual void yield() = 0;
		virtual void sleep(u32 nTimeMs) = 0;

		virtual bool postEventFromUser(const SEvent& event) = 0;
		virtual void setEventReceiver(IEventReceiver* pReceiver) = 0;
		virtual IEventReceiver* getEventReceiver() = 0;

		virtual void minimizeWindow() = 0;
		virtual void maximizeWindow() = 0;
		virtual void restoreWindow() = 0;

		virtual void setWindowCaption(const std::tstring& strCaption) = 0;

		virtual bool isWindowActive() const = 0;
		virtual bool isWindowFocused() const = 0;
		virtual bool isWindowMinimized() const = 0;
		virtual bool isFullscreen() const = 0;

		virtual eDeviceTypes getDeviceType() const = 0;
	};

} // namespace device
} // namespace sol9